# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-sphinxcontrib-spelling
_pkgname=sphinxcontrib-spelling
pkgver=8.0.0
pkgrel=3
pkgdesc="Sphinx spelling extension"
url="https://pypi.org/project/sphinxcontrib-spelling"
arch="noarch"
license="BSD-2-Clause"
depends="python3 py3-sphinx py3-enchant"
makedepends="
	py3-gpep517
	py3-setuptools_scm
	py3-wheel
	"
checkdepends="py3-pytest enchant2-aspell aspell-en"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

replaces="py-sphinxcontrib-spelling" # Backwards compatibility
provides="py-sphinxcontrib-spelling=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
0d8c21ea660516238c43fabb505666dfee15abb39f538c40c6b61f91e20c246b16aa170cd444263507dd51913a27fc7719cddb28f30eab26825b565f70dd3ab6  sphinxcontrib-spelling-8.0.0.tar.gz
"
